Ext.namespace('VAS');

VAS.DynamicRadioGroup=Ext.extend(Ext.form.RadioGroup,{
 initComponent : function() {
 	var _this=this;
	_this.items =  _this.getData(_this.staticData);
 	var thisConfig={
 		height : 21
 		,name  : _this.name
 		,width :_this.width
        ,fieldLabel : _this.fieldLabel
        ,readOnly : _this.readOnly
        ,items : _this.items
      };
 	
	 Ext.apply(this, thisConfig);
	 Ext.apply(this.initialConfig, thisConfig);
	 VAS.DynamicRadioGroup.superclass.initComponent.apply(this);
 },

getData:function(_staticData){
   var _arrayData=[];
	for(var i=0;i<_staticData.length;i++){
		var _objdata={};
		var obj={};
		obj=_staticData[i];
		if(this.value == obj.key){
			_objdata = {boxLabel:obj.value,inputValue:obj.key,name:this.name,checked: true }
		}else{
			_objdata = {boxLabel:obj.value,inputValue:obj.key,name:this.name}
		}
		_arrayData.push(_objdata);
	}
	return _arrayData;
}

});

Ext.reg('dynamicRadioGroup',VAS.DynamicRadioGroup);